package com.wyzz.hr.action;

import com.wyzz.hr.base.DWRUtil;
import com.wyzz.hr.bo.impl.LrDataCheckImpl;
import com.wyzz.hr.pojo.Leaverequest;
import com.wyzz.hr.spring.SpringBeanFactory;
import com.wyzz.hr.util.SystemPropertiesReader;

public class DWRSystemConfigReader {

	public DWRSystemConfigReader() {
	}

	public String readLeaveRequestRemindContent(Leaverequest leaveRequest) {
		if (DWRUtil.checkAuth("empLRAddDo", "execute").endsWith("error"))
			return "\u60A8\u65E0\u6743\u6267\u884C\u6B64\u64CD\u4F5C\uFF0C\u8BF7\u767B\u5F55\u540E\u91CD\u8BD5\uFF01";
		LrDataCheckImpl check = (LrDataCheckImpl) SpringBeanFactory
				.getBean("lrDataCheck");
		String msg = check.getLrTimeInfo(leaveRequest);
		SystemPropertiesReader reader = SystemPropertiesReader.getInstance();
		boolean remindEnable = reader.getBoolean("LR.Remind");
		if (!remindEnable) {
			return msg;
		} else {
			String remindString = (new StringBuilder()).append(msg).append(
					"\n\n").toString();
			remindString = (new StringBuilder()).append(remindString).append(
					reader.getValue((new StringBuilder()).append(
							"LR.Remind.Wording_").append(
							leaveRequest.getLrLtNo().getLtSpecialCat())
							.toString(), reader.getValue("LR.Remind.Wording")))
					.toString();
			return remindString;
		}
	}
}
